import request from "@/util/request.js"


// 登录方法
export function login(data) {
    // const data = {
    //     username,
    //     password,
    //     code,
    //     codeKey
    // };
    return request({
        url: "/api/login/",
        method: "post",
        data: data
    });
}

// 获取用户详细信息
export function getInfo() {
    return request({
        url: "/api/getInfo/",
        method: "get"
    });
}


// 获取用户详细信息
export function checkUser() {
    return request({
        url: "/api/checkUser/",
        method: "get"
    });
}

// 退出方法
export function logout(token) {
    const data = {token};
    return request({
        url: "/api/logout/",
        method: "post",
        data: data
    });
}

// 获取验证码
export function getCodeImg() {
    return request({
        url: "/captcha/refresh/",
        method: "get"
    });
}

// 通过企微二维码登陆
export function getUserByCode() {
    const data = {
        code
    };
    return request({
        url: "/api/getUserbycode/",
        method: "post",
        data: data
    });
}